package io.github.bloquesoft.entity.clazz;

import io.github.bloquesoft.entity.definition.AbstractPropertyDefinition;
import io.github.bloquesoft.entity.definition.EntityDefinition;
import io.github.bloquesoft.entity.definition.ListPropertyDefinition;
import io.github.bloquesoft.entity.definition.PropertyType;
import lombok.Getter;

import java.lang.reflect.Field;

public class ClassListPropertyDefinition extends AbstractPropertyDefinition implements ListPropertyDefinition {

    @Getter
    private final Field field;

    private final ClassEntityDefinition listItemEntityDefinition;

    public ClassListPropertyDefinition(Field listField, ClassEntityDefinition listItemEntityDefinition) {
        super(listField.getName(), PropertyType.List);
        this.field = listField;
        this.listItemEntityDefinition = listItemEntityDefinition;

    }

    @Override
    public EntityDefinition getListItemEntityDefinition() {
        return this.listItemEntityDefinition;
    }
}
